<?php
	echo "<div id=\"myCarousel\" class=\"carousel\">";
		echo "<div class=\"carousel-inner\">";
			echo "<div class=\"active item\"><img class=\"center\" height=\"100%\" width=\"100%\" src=\"./img/720x400/uss1.jpg\"/></div>";
			echo "<div class=\"item\"><img class=\"center\" height=\"100%\" width=\"100%\" src=\"./img/720x400/uss2.jpg\"/></div>";
			echo "<div class=\"item\"><img class=\"center\" height=\"100%\" width=\"100%\" src=\"./img/720x400/uss3.jpg\"/></div>";
			echo "<div class=\"item\"><img class=\"center\" height=\"100%\" width=\"100%\" src=\"./img/720x400/uss4.jpg\"/></div>";
			echo "<div class=\"item\"><img class=\"center\" height=\"100%\" width=\"100%\" src=\"./img/720x400/uss5.jpg\"/></div>";
		echo "</div>";
		echo "<a class=\"carousel-control left\" href=\"#myCarousel\" data-slide=\"prev\">&lsaquo;</a>";
		echo "<a class=\"carousel-control right\" href=\"#myCarousel\" data-slide=\"next\">&rsaquo;</a>";
	echo "</div>";
	echo "<h1>What's new</h1>";
		error_reporting (E_ALL ^ E_NOTICE);
		$blogdate = $_POST["blogdate"];
		$blogtitle = $_POST["blogtitle"];
		$blogcontent = $_POST["blogcontent"];
		$blogauthor = $_POST["blogauthor"];
		if ($blogdate != "" && $blogtitle != "" && $blogcontent != "" && $blogauthor != "") {
			$xml = simplexml_load_file('./data/blog.xml');
			$blog = $xml->addChild('blog');
			$date = date_create($blogdate);
			$date = $blog->addChild('date', date_format($date, 'Y-m-d H:i:s'));
			$author = $blog->addChild('author', $blogauthor);
			$content = $blog->addChild('content', htmlspecialchars(utf8_encode($blogcontent)));
			$author = $blog->addChild('author', $blogauthor);
			$xml->asXML('./data/blog.xml');
		}
		$xml = simplexml_load_file('./data/blog.xml');
		foreach ($xml->children() as $child) {
			echo "<p>" . $child->content . "</p><br/>";
			$date = date_create($child->date);
			echo "posted by " . $child->author . " on " . date_format($date, 'Y-m-d H:i:s') . "<br/>";
			echo "<hr/>";
		}
?>